﻿@model HQPad.Models.SilhouetteRecord
           
<div class="character-silhouette">
    <div class="hits tooltipable"><span class="total-hits">@Html.Raw(@Model.Life.TotalLife.ToString())</span>&nbsp;:&nbsp;<span class="location-hits">@Html.Raw(@Model.Life.LocationalLife.ToString())</span></div>
    <div class="tooltip" style="display:none;">You have <span class="total-hits">@Html.Raw(@Model.Life.TotalLife.ToString())</span> total life and <span class="location-hits">@Html.Raw(@Model.Life.LocationalLife.ToString())</span> per location</div>
    <table class="acs">
        <thead>
            <tr>
                <th colspan="2">Armour class</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var acRecord in Model.AC)
            {
                <tr class="named-tooltip @Html.Raw(acRecord.Name.ToLower())" tip="@Html.Raw(acRecord.Name.ToLower())">
                    <th>@Html.Raw(acRecord.Name)</th>
                    <td>@Html.Raw(acRecord.Total.ToString()) : @Html.Raw(acRecord.Pure.ToString())</td>
                </tr>

            }
        </tbody>
    </table>

            @foreach (var acRecord in Model.AC)
            {                
                <div id="tooltip-@Html.Raw(acRecord.Name.ToLower())" class="tooltip" style="display:none;">
                    @Html.Raw(acRecord.Name) AC
                    
                    <table class="bonus-sources right">
                        @foreach (var source in acRecord.Sources)
                        {
                            <tr>
                                <td class="source-name">
                                    @Html.Raw(source.Name)
                                    @if (!string.IsNullOrEmpty(source.Parent))
                                    {
                                        <br /><span class="parent">(@Html.Raw(source.Parent))</span>
                                    }    
                                </td>
                                <td class="source-value">@Html.Raw(source.Value.ToString())</td>
                            </tr>
                        }
                        <tr>
                            <td class="source-name">AC:</td>
                            <td class="source-value total-cell">@Html.Raw(acRecord.Total.ToString()) 

                            </td>
                        </tr>
                        @if (acRecord.Total != acRecord.Pure)
                        {
                            <tr>
                                <td class="source-name">Pure AC:</td>
                                <td class="source-value">
                                    <span class="pure">@Html.Raw(acRecord.Pure.ToString())</span>
                                </td>
                            </tr>
                        }
                    </table>
                </div>
            }
</div>